﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TeacherMeritPayByTerm.aspx.cs" Inherits="Basic4Net.OAWeb.Module_Report.TeacherMeritPayByTerm" %>

<%@ Register Assembly="Controls" Namespace="Basic4Net.Controls" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>学期教职工奖教奖学绩效工资报表</title>
    <link href="../App_Themes/ui-lightness/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

    var IsSuper = <%=bIsSuper?1:0 %>;

    function TopClick() {
        document.getElementById("txt_Go").value = 1;
        document.getElementById("btnSearch").click();
        document.getElementById("lbl_ToPage").innerHTML = 1;
    }

    function UpClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) > 1) {
            txt.value = parseInt(txt.value) - 1;
            document.getElementById("btnSearch").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }
    }

    function NextClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) < parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
            txt.value = parseInt(txt.value) + 1;
            document.getElementById("btnSearch").click();
            document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
        }
    }

    function EndClick() {
        document.getElementById("txt_Go").value = document.getElementById("lbl_PageCount").innerHTML;
        document.getElementById("btnSearch").click();
        document.getElementById("lbl_ToPage").innerHTML = document.getElementById("txt_Go").value;
    }

    function GoClick() {
        var txt = document.getElementById("txt_Go");
        if (parseInt(txt.value) >= parseInt(document.getElementById("lbl_PageCount").innerHTML)) {
            txt.value = document.getElementById("lbl_PageCount").innerHTML;
        }
        if (parseInt(txt.value) <= 1) {
            txt.value = 1;
        }
        if (isNaN(parseInt(txt.value))) {
            txt.value = 1;
        }
        document.getElementById("btnSearch").click();
        var patrn = /^[1-9]\d*$/;
        if (patrn.exec(txt.value)) {
            document.getElementById("lbl_ToPage").innerHTML = txt.value;
        }

    }

    function AddSumRow(SumAmountIssued) {
        var table = document.getElementById("reportTable");
        var tr = table.insertRow();

        var td1 = tr.insertCell();
        td1.colSpan = 3;
        td1.innerText = "合计：";
        td1.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";

        var td2 = tr.insertCell();
        td2.style.cssText = "text-align:right;padding-right:5px;font-weight:bold;";
        td2.innerText = SumAmountIssued;
    }

    function Load() {
        if(IsSuper == "0"){
            document.getElementById("dPage").style.display="none";
        }
        else{
            document.getElementById("dPage").style.display="";
        }
    }
    </script>
</head>
<body onload="Load();">
    <form id="form1" runat="server">
    <div class="mainWarp">
		<div class="pageBody">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    <div  style=" margin-top:8px; margin-left:5px;">
        <label>年月:</label>
        <asp:DropDownList ID="drDate" runat="server" OnSelectedIndexChanged="DrDateChanged" AutoPostBack="True">
        </asp:DropDownList>

        &nbsp;
        <asp:DropDownList ID="ddlSearchType" runat="server">
        </asp:DropDownList>
&nbsp;
        <asp:TextBox ID="txtCode" runat="server"></asp:TextBox>
        &nbsp;<asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="BtnSearchClick" CssClass="commonBut"/>
    </div>
    
			<asp:UpdatePanel ID="pUpdatePanel" runat="server">
				<ContentTemplate>					
					<asp:Repeater ID="pRepeater" runat="server">
						<HeaderTemplate>
							<table id="reportTable" class="useList" style="width: 60%">
								<tr>
									<th width="20%" style="text-align: left; padding-left:5px;">
										编号
									</th>
									<th width="25%" style="text-align: left; padding-left:5px;">
										姓名
									</th>
									<th width="25%" style="text-align: left; padding-left:5px;">
										绩效考核等级
									</th>
									<th width="30%" style="text-align: right; padding-right:5px;">
										应发金额
									</th>
								</tr>
						</HeaderTemplate>
						<ItemTemplate>
							<tr>
								<td style="text-align: left;padding-left:5px;">
									<%#Eval("TeacherCode")%>
								</td>
								<td style="text-align: left;padding-left:5px;">
									<%#Eval("TeacherName")%>
								</td>
								<td style="text-align: left;padding-left:5px;">
									<%#Eval("MeritPayLevel").ToString() == "NULL" ? "无" : Eval("MeritPayLevel")%>
								</td>
								<td style="text-align: right;padding-right:5px;">
									<%#Eval("AmountIssued").ToString() == "" ? "无" : Math.Round(double.Parse(Eval("AmountIssued").ToString()),2).ToString() %>
								</td>
							</tr>
						</ItemTemplate>
						<FooterTemplate>
							</table>
						</FooterTemplate>
					</asp:Repeater>
                    <div id="dPage" class="page" style="width: 60%; margin-top: 10px;white-space:nowrap;">
                                    <span>
                                        <input id="lbnTop" type="button" value="首页" class="commonBut" onclick="TopClick()" /></span>
                                    <span>
                                        <input id="lbnUp" type="button" value="上一页" class="commonBut" onclick="UpClick()" /></span>
                                    <span>
                                        <input id="lbnNext" type="button" value="下一页" class="commonBut" onclick="NextClick()" /></span>
                                    <span>
                                        <input id="lbnEnd" type="button" value="末页" class="commonBut" onclick="EndClick()" /></span>
                                    <span class="disabled">
                                        <asp:Label ID="lbl_L_Di" runat="server" Text="第"></asp:Label>
                                        <asp:Label ID="lbl_ToPage" runat="server" Text="0"></asp:Label>
                                        /
                                        <asp:Label ID="lbl_PageCount" runat="server" Text="0"></asp:Label>
                                        <asp:Label ID="lbl_L_Yie" runat="server" Text="页"></asp:Label></span> <span>
                                            <asp:Label ID="lbl_L_TD" runat="server" Text="跳到"></asp:Label><span class="shoppingnumber">
                                                <asp:TextBox ID="txt_Go" CssClass="logininput" Text="" runat="server" Width="50px" ></asp:TextBox>
                                                <%--<asp:RegularExpressionValidator ID="REV_Go" runat="server" ErrorMessage="RegularExpressionValidator"
                                                    Display="Dynamic" ControlToValidate="txt_Go" ValidationExpression="^[1-9]\d*$">*</asp:RegularExpressionValidator>--%>
                                            </span>
                                            <asp:Label ID="lbl_L_Yie2" runat="server" Text="页"></asp:Label></span> <span>
                                                <input id="lbnGo" type="button" value="跳转" class="commonBut" onclick="GoClick()" /></span>
                                </div>
				</ContentTemplate>
                <Triggers>
					<asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
                    <asp:AsyncPostBackTrigger ControlID="drDate" EventName="SelectedIndexChanged" />
                    <asp:AsyncPostBackTrigger ControlID="ddlSearchType" EventName="SelectedIndexChanged" />
				</Triggers>
			</asp:UpdatePanel>
		</div>
	</div>
	</form>
</body>
</html>
